<?php
/**
 * Analyse Application 
 * @author	zhangjian<smile_for_life@sina.cn>
 * @date	2014-01-14
 */
 class Analyse
 {
	public static function run($config = array())
	{
		$return = false;
		
		if(is_array($config) && $config){
		
			$param = $config['Task']['param'];
			$tasks = $config['Task'];
			if(is_array($tasks) && $tasks){
				foreach($tasks as $task_class){
					$task = new $task_class['class_name'];
					if($task->init($config)){
						$return = $task->handle($param);
						if($return){
							$task->clean();
						}
					}
				}
				
			}
		}
		
		return $return;
		
	}
	
 }